<template>
	<view class="container">
		<uni-section title="食物轮播图展示" sub-title="" type="line">
			<swiper :indicator-dots="true" :autoplay="true" :interval="3000" :duration="1000">
				<swiper-item v-for="(item, index) in foodSwiperList" :key="index">
					<view class="swiper-item">
						<image :src="`http://localhost:8090${item.icon}`" mode="widthFix"></image>
					</view>
				</swiper-item>
			</swiper>
		</uni-section>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				foodSwiperList: []
			}
		},
		methods: {

		},
		onLoad() {
			uni.request({
				url: 'http://localhost:8090/foodapp/foodSwiper/list',
				method: 'POST',
				success: res => {
					this.foodSwiperList = res.data.list;
				}
			});
		}
	}
</script>

<style>
	image {
		width: 100%;
		height: 100%;
	}
	.swiper-item {
		width: 100%;
		height: 100%;
	}
</style>
